<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
        />
        <script type="text/javascript" src="/Extjs/bootstrap.js"></script>
        <script type="text/javascript" src="/Extjs/extux.js"></script>
        <link rel="stylesheet" type="text/css" href="/Extjs/resources/css/ext-all.css"
        />
        <link href="/Extjs/ux/grid/css/RangeMenu.css" rel="stylesheet" type="text/css"
        />
        <link href="/Extjs/ux/grid/css/GridFilters.css" rel="stylesheet" type="text/css"
        />
        <link rel="stylesheet" type="text/css" href="/css/main.css" />
        <script type="text/javascript" src="/Extjs/locale/ext-lang-zh_CN.js"></script>
        <script type="text/javascript">
            //<!--


            Ext.Loader.setConfig({
                enabled: true
            });

            Ext.Loader.setPath('Ext.ux', '/Extjs/ux');

            Ext.require([

            'Ext.grid.*',

            'Ext.data.*',

            'Ext.dd.*',

            'Ext.ux.grid.FiltersFeature',

            'Ext.toolbar.Paging'

            ]);

            Ext.onReady(function () {                
                var model_form = Ext.create("Ext.form.Panel", {
                    'renderTo':'form',
                    'title':'add',
                    "url": "/modeling/add/",
                    "items": [{
                        "xtype": "textfield",
                        "columnWidth": ".5",
                        "name": "name",
                        "fieldLabel": "name",
                        "allowBlank": false,
                        "value": null
                    },  {
                        "xtype": "textfield",                        
                        "columnWidth": ".5",
                        "name": "displayname",
                        "fieldLabel": "displayname",
                        "allowBlank": true,
                        "value": null
                    }],
                    "buttons": [{
                        "text": "submit",
                        "handler": function () {
                            var form = this.up('form').getForm();
                            if (form.isValid()) {
                                form.submit({
                                    success: function (form, action) {                                                                            
                                        window.location = '/modeling/edit/name/' + action.result.name;                      
                                        
                                    },
                                    failure: function (form, action) {
                                        Extux.msg('failed', '');
                                    }
                                });
                            }
                        }
                    }, {
                        "text": "return",
                        "handler": function () {
                            history.back();
                        }
                    }]
                });              
            });
            //-->
        </script>
    </head>
    
    <body>
        <div id="form"></div>
    </body>

</html>